<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateGoodsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('goods', function(Blueprint $table)
		{
			$table->increments('id')->comment('商品序号');
			$table->integer('class_id')->comment('商品分类的id');
			$table->string('name')->nullable()->comment('商品名称');
			$table->string('goods_info')->nullable()->comment('商品信息');
			$table->string('img')->nullable()->comment('商品图片');
			$table->string('goods_num')->nullable()->default('0')->comment('商品数量');
			$table->string('product_code')->nullable()->default('0')->comment('商品编号');
			$table->string('site')->nullable()->comment('产址');
			$table->string('work_company')->nullable()->comment('加工企业');
			$table->integer('status')->unsigned()->nullable()->default(1)->comment('0上架1下架');
			$table->string('productdate')->nullable()->comment('保质期');
			$table->string('area')->nullable()->comment('产地');
			$table->decimal('price', 5)->nullable()->comment('单价');
			$table->dateTime('product_at')->nullable()->comment('生产日期');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('goods');
	}

}
